const Router = require('koa-router');
const router = new Router();
const readerController = require('../controllers/readerController');
const commentController = require('../controllers/commentController');
const authMiddleware = require('../middleware/auth');

// 以下所有路由都需要认证
router.use(authMiddleware);

router.get('/profile', readerController.getProfile);
router.put('/profile', readerController.updateProfile);

// Comment routes
router.put('/comments/:id', commentController.updateComment);
router.delete('/comments/:id', commentController.deleteComment);
router.post('/comments/:id/like', commentController.likeComment);
router.post('/novels/:id/comments', commentController.createComment);

module.exports = router;